import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: "/home" //重定向
}, {
    // 首页
    path: "/home",
    name: "Home",
    component: () =>
        import ('../views/my-home.vue'),
    children: [{
        path: 'page01',
        component: () =>
            import ('../pages/home-page01.vue')
    }, {
        path: "page02",
        component: () =>
            import ('../pages/home-page02.vue')
    }]
}, {
    //详情列表页 
    path: '/comment',
    name: "Comment",
    component: () =>
        import ('../pages/home-comment.vue')
}, {
    // 分类
    path: '/category',
    name: "Category",
    component: () =>
        import ('../views/my-category.vue')
}, {
    // 动态
    path: "/dynamic",
    name: "Dynamic",
    component: () =>
        import ('../views/my-dynamic.vue'),
    children: [{
        path: "dypage01",
        component: () =>
            import ('../pages/dynamic-page01.vue')
    }, {
        path: "dypage02",
        component: () =>
            import ('../pages/dynamic-page02.vue')
    }]
}, {
    path: '/center',
    name: "Center",
    component: () =>
        import ('../views/my-center.vue')
}, {
    path: "/search",
    name: "Search",
    component: () =>
        import ('../views/my-search.vue')
}, {
    path: '/demofu', //测试
    name: 'Demofu',
    component: () =>
        import ('../views/demofu.vue')
}, {
    path: '/mylove',
    name: "Love",
    component: () =>
        import ('../views/my-love.vue')
}, {
    path: "/addtxt",
    name: 'addTxt',
    component: () =>
        import ('../views/my-addtxt.vue')
}, {
    path: '/mysend',
    name: 'mySend',
    component: () =>
        import ('../views/my-send.vue')
}, {
    path: '/figswiper',
    name: 'figswiper',
    component: () =>
        import ('../views/figswiper.vue')
}, {
    path: "/leftRight",
    component: () =>
        import ('../views/leftRight.vue')
}]

const router = new VueRouter({
    linkActiveClass: 'active', // 配置导航链接的点击高亮效果
     linkExactActiveClass: 'active', // 排除二级路由和一级路由点击冲突高亮的效果
    routes
})

export default router